home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / sock.h < prev    next >
C/C++ Source or Header  |  2001-05-12  |  1KB  |  50 lines

  1.  
  2. #ifndef _TEK_SOCKTASK_H
  3. #define    _TEK_SOCKTASK_H 1
  4.  
  5. #include <tek/msg.h>
  6.  
  7. /* 
  8. **    tek/sock.h
  9. **
  10. **    socket communication
  11. **
  12. */
  13.  
  14.  
  15. /* 
  16. **    host/network endian swapping macros.
  17. **    the underlying macros need to be defined elsewhere,
  18. **    typically they are included with <tek/type.h>
  19. */
  20.  
  21.  
  22. #define THTON32(x)    htonl(x)
  23. #define THTON16(x)    htons(x)
  24. #define TNTOH32(x)    ntohl(x)
  25. #define TNTOH16(x)    ntohs(x)
  26.  
  27.  
  28. /* 
  29. **    tags
  30. */
  31.  
  32. #define TSOCKTAGS_                (TTAG_USER + 0x500)
  33. #define TSock_ReplyTimeout        (TTAG) (TSOCKTAGS_ + 0)            /* maximum time allowed for a reply */    
  34. #define TSock_IdleTimeout        (TTAG) (TSOCKTAGS_ + 1)            /* maximum idle time on a connection */
  35. #define TSock_MaxMsgSize        (TTAG) (TSOCKTAGS_ + 2)            /* maximum msg size to accept via socket */
  36.  
  37.  
  38. TBEGIN_C_API
  39.  
  40.  
  41. extern TUINT TAddSockPort(TPORT *msgport, TUINT portnr, TTAGITEM *tags)                        __ELATE_QCALL__(("qcall lib/tek/sock/addsockport"));
  42. extern TVOID TRemSockPort(TPORT *msgport)                                                    __ELATE_QCALL__(("qcall lib/tek/sock/remsockport"));
  43. extern TPORT *TFindSockPort(TAPTR task, TSTRPTR ipname, TUINT16 portnr, TTAGITEM *tags)        __ELATE_QCALL__(("qcall lib/tek/sock/findsockport"));
  44.  
  45.  
  46. TEND_C_API
  47.  
  48.  
  49. #endif
  50.